//
//  HistoryOrderDetailHeaderView.m
//  FactorySale
//
//  Created by 主事丫环HU on 2020/8/4.
//  Copyright © 2020 主事丫环. All rights reserved.
//

#import "HistoryOrderDetailHeaderView.h"
@interface HistoryOrderDetailHeaderView()
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *phoneLabel;
@property (weak, nonatomic) IBOutlet UITextView *addressTextView;
@property (weak, nonatomic) IBOutlet UILabel *companyNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *orderNumberLabel;
@property (weak, nonatomic) IBOutlet UILabel *accountLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *totalMoneyLabel;
@property (weak, nonatomic) IBOutlet UIView *companyBgView;
@property (weak, nonatomic) IBOutlet UIView *accountBgView;
@end
@implementation HistoryOrderDetailHeaderView

- (void)setModel:(UnpaidOrHistoryOrderInfoDetailModel *)model{
    [self.addressTextView setEditable:NO];
    self.nameLabel.text = model.name;
    self.phoneLabel.text = model.phone;
    self.addressTextView.text = model.address;
    self.companyNameLabel.text = model.logistics_name;
    self.orderNumberLabel.text = model.logistics_num;
    self.timeLabel.text = [NSString stringWithFormat:@"下单时间：%@",model.create_time];
    self.totalMoneyLabel.text = [NSString stringWithFormat:@"¥%@",model.total_amount];
    self.accountLabel.text = [NSString stringWithFormat:@"%@ %@",model.bank_name,model.card_no];
    if ([model.logistics_name isKindOfClass:[NSNull class]] || [model.logistics_name isEqual:[NSNull null]] || model.logistics_name == nil || [model.logistics_name isEqualToString:@""]){
        self.companyBgView.hidden = YES;
    } else {
        self.companyBgView.hidden = NO;
    }
    if ([model.bank_name isKindOfClass:[NSNull class]] || [model.bank_name isEqual:[NSNull null]] || model.bank_name == nil || [model.bank_name isEqualToString:@""]){
        self.accountBgView.hidden = YES;
    } else {
        self.accountBgView.hidden = NO;
    }
}

@end
